home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #2 / Amiga Plus CD - 2004 - No. 02.iso / AmiSoft / Misc / emu / Wzonka-Lad.lha / Wzonka-Lad / src / do_sounds.i < prev    next >
Text File  |  1998-06-04  |  2KB  |  104 lines

  1. ;««««««««««««««««««««««««««««««««««««««««««««««»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»
  2. ;        sound emulation routines
  3. ;««««««««««««««««««««««««««««««««««««««««««««««»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»
  4.  
  5. do_sounds:    movem.l    d0-d7/a0-a6,-(SP)
  6.  
  7. ;««««««««««««««««««««««««««««««««««««««««««««««»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»
  8. ;        channel three
  9. ;««««««««««««««««««««««««««««««««««««««««««««««»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»
  10.  
  11.         move.l    gb_memory,a0
  12.         add.l    #$ff1a,a0
  13.         btst.b    #7,(a0)
  14.         beq.w    no_sound_III        
  15.  
  16.         move.l    ahi_base,a6
  17.         moveq.l    #0,d0                ;sound.
  18.         move.l    ahi_audio_ctrl,a2
  19.         jsr    AHI_UnLoadSound(a6)
  20.  
  21.         move.l    gb_memory,a1
  22.         add.l    #$ff30,a1
  23.         lea    smpl_I_bn,a2
  24.         moveq.l    #16-1,d0
  25. sound_III_de:    move.b    (a1)+,d1
  26.         move.b    d1,d2
  27.         lsr.b    #4,d1
  28.         lsl.b    #4,d1
  29.         sub.b    #$ff/2,d1
  30.         move.b    d1,(a2)+
  31.  
  32.         and.b    #%1111,d2
  33.         lsl.b    #4,d2
  34.         sub.b    #$ff/2,d2
  35.         move.b    d2,(a2)+
  36.         dbra    d0,sound_III_de
  37.  
  38.         move.l    ahi_base,a6
  39.         moveq.l    #0,d0                ;sample number.
  40.         move.l    #AHIST_DYNAMICSAMPLE,d1        ;type.
  41.         lea    smpl_info_I,a0            ;info field.
  42.         move.l    ahi_audio_ctrl,a2        ;ctrl.
  43.         jsr    AHI_LoadSound(a6)
  44.  
  45.         move.l    gb_memory,a0
  46.         add.l    #$ff1e,a0
  47.         moveq.l    #0,d2
  48.         move.b    (a0),d2
  49.         and.b    #%111,d2
  50.         lsl.w    #8,d2
  51.         subq.l    #1,a0
  52.         move.b    (a0),d2
  53.         move.l    #4194304,d1
  54.         move.l    #2048,d3
  55.         sub.l    d2,d3
  56.         lsl.l    #5,d3
  57.         divu.l    d3,d1                ;d1 = frequency.
  58.  
  59.         move.l    ahi_base,a6
  60.         moveq.l    #0,d0                ;channel.
  61. ;        move.l    #100,d1                ;freq.
  62.         moveq.l    #0,d2
  63.         bset    #AHISB_IMM,d2            ;flags.
  64.         move.l    ahi_audio_ctrl,a2
  65.         jsr    AHI_SetFreq(a6)
  66.  
  67.         move.l    gb_memory,a0
  68.         add.l    #$ff1c,a0
  69.         moveq.l    #0,d1
  70.         move.b    (a0),d1
  71.         lsr.b    #5,d1
  72.         and.b    #%11,d1
  73.         lea    channel_III_vol,a1
  74.         move.l    (a1,d1.l*4),d1            ;new volume.
  75.  
  76.         move.l    ahi_base,a6
  77.         moveq.l    #0,d0                ;channel.
  78. ;        move.l    #$10000,d1            ;volume (max).
  79.         move.l    #$8000,d2            ;pan.
  80.         moveq.l    #0,d3
  81.         bset    #AHISB_IMM,d3            ;flags.
  82.         move.l    ahi_audio_ctrl,a2
  83.         jsr    AHI_SetVol(a6)
  84.         bra.s    sound_III_done
  85.  
  86. no_sound_III:    move.l    ahi_base,a6
  87.         moveq.l    #0,d0                ;channel.
  88.         move.l    #0,d1                ;volume (min).
  89.         move.l    #$8000,d2            ;pan.
  90.         moveq.l    #0,d3
  91.         bset    #AHISB_IMM,d3            ;flags.
  92.         move.l    ahi_audio_ctrl,a2
  93.         jsr    AHI_SetVol(a6)
  94.  
  95. sound_III_done:    
  96.  
  97. ;««««««««««««««««««««««««««««««««««««««««««««««»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»
  98. ;        exit from the sound emulation
  99. ;««««««««««««««««««««««««««««««««««««««««««««««»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»
  100.  
  101.         movem.l    (SP)+,d0-d7/a0-a6
  102.         rts
  103.  
  104.